<template>
  <div class="home">

    <!-- 三级联动全局组件 -->
    <type-nav/>
    <!--  home组件  -->
    <list-container/>
    <recommend/>
    <rank/>
    <like/>
    <Floor v-for="floor in floorList" :key="floor.id" :floor="floor"/>
    <Brand/>


  </div>
</template>

<script>


import ListContainer from "./ListContainer";
import Recommend from "./Recommend";
import Rank from "./Rank";
import Like from "./Like";
import Floor from "./Floor";
import Brand from "./Brand";

import {mapState} from "vuex";


export default {
  name: 'Home',
  components: {Brand, Floor, Like, Rank, Recommend, ListContainer},
  created() {
    //派发获取floor组件的数据
    this.$store.dispatch('getFloorList')
    //获取用户信息在首页展示
    this.$store.dispatch('getUserInfo')
  },
  computed: {
    ...mapState({
      floorList: state => state.home.floorList
    })
  }


}
</script>


<style>

</style>